// Tierless
// Copyright © 2010 Alphora
// This file is licensed under a modified BSD-license (see tierless_license.txt).
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace Tierless.Framework.Data
{
	/// <summary>
	/// Represents the result of an EntitySave call.
	/// </summary>
	[DataContract]
	public class EntitySaveResult
	{
		/// <summary>
		/// Initializes a new instance of the EntitySaveResult class.
		/// </summary>
		/// <param name="successful">True if the save was successful, false otherwise.</param>
		/// <param name="entitySets">A list of entity sets describing the resulting entities after the save.</param>
		public EntitySaveResult(bool successful, List<EntitySet> entitySets)
		{
			_successful = successful;
			_entitySets = entitySets;
		}

		[DataMember]
		private bool _successful;

		/// <summary>
		/// Gets whether or not the save was successful.
		/// </summary>
		public bool Successful
		{
			get { return _successful; }
		}

		[DataMember]
		private List<EntitySet> _entitySets;

		/// <summary>
		/// Gets the list of entity sets containing the saved entities.
		/// </summary>
		public List<EntitySet> EntitySets
		{
			get { return _entitySets; }
		}
	}
}